﻿<StatusBar x:Class="GBlason.Control.Aggregate.ApplicationStatusBar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:ViewModel="clr-namespace:GBlason.ViewModel"
           xmlns:CustomUserControl="clr-namespace:GBlason.Control.CustomUserControl"
           xmlns:Converter="clr-namespace:GBlason.Common.Converter"
           xmlns:General="clr-namespace:GBlason.ViewModel.General" mc:Ignorable="d" 
           Style="{StaticResource StatusBarStyle}"
             d:DesignHeight="60" d:DesignWidth="800">
    <StatusBar.Resources>
        <Converter:DoubleToZoomLevel x:Key="ZoomLevelConverter"/>
    </StatusBar.Resources>
    <DockPanel VerticalAlignment="Stretch">
        <StatusBarItem DockPanel.Dock="Left" x:Name="ZoomStatusBarItem"
                       DataContext="{Binding Source={x:Static General:GlobalApplicationViewModel.GetApplicationViewModel}, Path=CurrentlyDisplayedFile, TargetNullValue={x:Static General:GbsFileViewModel.DefaultGbsFile}}">
            <DockPanel>
                <Image DockPanel.Dock="Left" Source="/GBlason;component/Pictures/Icons16/magnifier_zoom_out.png"
               Height="16" Width="16"/>
                <Slider DockPanel.Dock="Left" x:Name="zoomSlider" Minimum="0.1" Maximum="10" 
                        Value="{Binding Path=ZoomLevel}" 
                        Margin="2,0" MinWidth="150"
                        VerticalAlignment="Center"/>
                <Image DockPanel.Dock="Left" Source="/GBlason;component/Pictures/Icons16/magnifier_zoom_in.png"
               Height="16" Width="16"/>
                <CustomUserControl:CommandComboBox DockPanel.Dock="Left"
                                                   Margin="2,0"
                                                   x:Name="ComboBoxZoomLevels"
                                                   ItemsSource="{Binding Path=AvailableZoom}"
                                                   SelectedItem="{Binding Path=ZoomLevel, Converter={StaticResource ZoomLevelConverter}, ConverterParameter=CurrentlyDisplayedFile}"
                                                   SelectionChanged="CommandComboBoxSelectionChanged">
                    <CustomUserControl:CommandComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Center" Text="{Binding Path=Name}" Foreground="Black"
                                       Margin="2"/>
                        </DataTemplate>
                    </CustomUserControl:CommandComboBox.ItemTemplate>
                </CustomUserControl:CommandComboBox>
            </DockPanel>
        </StatusBarItem>
        <Separator DockPanel.Dock="Left" Style="{StaticResource StatusBarSeparator}" HorizontalAlignment="Center" VerticalAlignment="Stretch"
                   MinHeight="16"/>
        <StatusBarItem></StatusBarItem>
    </DockPanel>
</StatusBar>
